package com.d3works.apps.purchase.service;

import com.d3works.apps.purchase.db.PurchaseOrder;
import com.d3works.exception.D3worksException;

public interface PurchaseOrderWorkflowService {

  /**
   * Set the purchase order status to draft.
   *
   * @param purchaseOrder
   * @throws D3worksException
   */
  void draftPurchaseOrder(PurchaseOrder purchaseOrder) throws D3worksException;

  /**
   * Set the the validator and the validation date to the purchase and change the order status to
   * validated.
   *
   * @param purchaseOrder
   * @throws D3worksException
   */
  void validatePurchaseOrder(PurchaseOrder purchaseOrder) throws D3worksException;

  /**
   * Set the purchase order status to finished.
   *
   * @param purchaseOrder
   * @throws D3worksException
   */
  void finishPurchaseOrder(PurchaseOrder purchaseOrder) throws D3worksException;

  /**
   * Set the purchase order status to canceled.
   *
   * @param purchaseOrder
   * @throws D3worksException
   */
  void cancelPurchaseOrder(PurchaseOrder purchaseOrder) throws D3worksException;
}
